<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="target-densitydpi=device-dpi, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="../../../../public/css/general.css">
    <link rel="stylesheet" href="../../../../public/css/mint-ui/lib/style.css">
    <link rel="stylesheet" href="../../../../public/css/iconfont/iconfont.css">
    <link rel="stylesheet" href="../../../../public/css/wechat/cart.css">
    <title>白蔬贞</title>
</head>
<body>
<!--确认订单-->
<div id="cart-order" :class="{'cart-order': show!='order'}">
    <div class="top-bar" :class="{'top-bar-gray': show!='order'}">
        <a href="javascript:;" @click="goBack()">
            <i class="iconfont">&#xe665;</i>
        </a>
        <span v-text="tip">确认订单</span>
    </div>
    <div class="placeholder"></div>
    <!--订单信息 开始-->
    <div class="order-info order-info_first" v-if="show=='order'">
        <div class="cell order-store_cell" v-if="store!=null">
            <div class="icon">
                <img src="../../../../public/images/order-location.png" alt="">
            </div>
            <div class="content">
                <div class="top">
                    <div class="title" v-text="store.name"></div>
                    <div class="phone" v-text="store.phone"></div>
                </div>
                <div class="clearfix"></div>
                <div class="middle" v-text="'收货地址：'+store.region+store.location"></div>
            </div>
            <div class="icon-jiantou">
                <img @click="showStores()" src="../../../../public/images/right.png" alt="">
            </div>
        </div>
        <div class="order-products_cell">
            <div class="products">
                <div class="product-img">
                    <img :src="getProduct(0).img" v-if="getProduct(0)!=null" alt="">
                </div>
                <div class="product-img">
                    <img :src="getProduct(1).img" v-if="getProduct(1)!=null" alt="">
                </div>
                <div class="product-img">
                    <img :src="getProduct(2).img" v-if="getProduct(2)!=null" alt="">
                </div>
                <div class="product-img">
                    <img v-if="getProduct(3)!=null" :src="getProduct(3).img" alt="">
                </div>
                <div class="text-ellipsis" v-text="'共'+products.length+'样商品'"></div>
            </div>
            <div class="icon-jiantou" @click="showProducts()">
                <img src="../../../../public/images/right.png" alt="">
            </div>
        </div>
    </div>
    <div class="order-info" v-if="show=='order'">
        <div class="cell">
            <div class="radio">
                <div class="label">微信支付</div>
                <div class="radio-right" @click="toChangeOrderPay('微信支付')">
                    <img v-if="order.orderPay=='微信支付'" src="../../../../public/images/radio-selected.png" alt="">
                    <img v-if="order.orderPay!='微信支付'" src="../../../../public/images/radio-unselected.png" alt="">
                </div>
            </div>
            <div class="radio">
                <div class="label">货到付款</div>
                <div class="radio-right" @click="toChangeOrderPay('货到付款')">
                    <img v-if="order.orderPay!='微信支付'" src="../../../../public/images/radio-selected.png" alt="">
                    <img v-if="order.orderPay=='微信支付'" src="../../../../public/images/radio-unselected.png" alt="">
                </div>
            </div>
            <div class="radio lijian" v-if="order.orderPay == '微信支付'">
                <div class="label">在线支付立减</div>
                <div class="radio-right" v-text="-discount"></div>
            </div>
        </div>
    </div>
    <div class="order-info" v-if="show=='order'">
        <div class="cell">
            <mt-field label="留言：" placeholder="" type="textarea" rows="4" v-model="order.remark"></mt-field>
        </div>
    </div>
    <!--底部-->
    <div class="tabbar" v-if="show=='order'">
        <div class="total"><span>合计：</span><span class="money" v-text="'¥'+total"></span></div>
        <div class="button">
            <div @click="pay()" class="pay">立即支付</div>
            <div @click="goShopping()" class="shopping">继续购物</div>
        </div>
    </div>
    <!--订单信息结束-->

    <!--查看清单开始-->
    <div class="products-panel" v-if="show=='products'" :style="{height: panelHeight+'px'}">
        <div class="product" v-for="p in products">
            <div class="title" v-text="p.name"></div>
            <div class="footer" v-text="p.num+p.unit"></div>
            <div class="clearfix"></div>
        </div>
    </div>
    <!--查看清单结束-->

    <!--选择门店开始-->
    <div class="store-panel" v-if="show=='store'" :style="{height: panelHeight+'px'}">
        <div class="store" v-for="store in storeList">
            <div class="radio" v-if="store.isDefault">
                <img src="../../../../public/images/radio-success.png" alt="单选按钮">
            </div>
            <div class="item">
                <div class="top">
                    <div class="title" v-text="store.name"></div>
                    <div class="fotter" v-text="store.phone"></div>
                </div>
                <div class="content" v-text="'收货地址：'+store.region+store.location"></div>
                <div class="bottom">
                    <div class="label">
                        <span v-show="store.isDefault" :class="{'is-default': store.isDefault}">默认</span>
                    </div>
                    <div class="fotter">
                        <span @click="editStore(store)"><img src="../../../../public/images/edit.png" alt="编辑">编辑</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="button" style="padding-top: 25px;">
            <img src="../../../../public/images/new-store.png" alt="新增门店" @click="toNewStore()">
        </div>
    </div>
    <!--选择门店结束-->
</div>
<script src="../../../../public/js/vue.js"></script>
<script src="../../../../public/css/mint-ui/lib/index.js"></script>
<script src="../../../../public/js/jquery.min.js"></script>
<script src="../../../../public/js/store.js"></script>
<script src="../../../../public/js/wechat/mixin.js"></script>
<script src="../../../../public/js/wechat/cart/order.js"></script>
</body>
</html>